﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace DataLayer
{
    [KnownType(typeof(PartBooking))]
    [DataContract(IsReference=true)]
    public class Booking
    {
        private DateTime _dateTime;
        private List<PartBooking> _partBookings;

        public Booking(DateTime dateTime, List<PartBooking> partbookings)
        {
            SetValues(dateTime, partbookings);
        }

        public Booking(DateTime dateTime) {
            SetValues(dateTime, null);
        }

        public Booking() {
            SetValues(new DateTime(), null);
        }

        private void SetValues(DateTime dateTime, List<PartBooking> partBookings) {
            _dateTime = dateTime;
            _partBookings = partBookings;
        }

        [DataMember]
        public DateTime DateTime
        {
            get { return _dateTime; }
            set { _dateTime = value; }
        }

        [DataMember]
        public List<PartBooking> PartBookings
        {
            get { return _partBookings; }
            set { _partBookings = value; }
        }
    }
}
